<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$ci = & get_instance();
	$upcoming_tournament_array = $ci->tournament_entity->getTournamentByStatus("upcoming");
	$living_tournament_array = $ci->tournament_entity->getTournamentByStatus("living");	
	$closed_tournament_array = $ci->tournament_entity->getTournamentByStatus("closed");	
	
	$tournament_array = array();
	foreach($upcoming_tournament_array as $item){
		$tournament_array[] = $item;
	}
	foreach($living_tournament_array as $item){
		$tournament_array[] = $item;
	}
	foreach($closed_tournament_array as $item){
		$tournament_array[] = $item;
	}
?>
<div id="center_content">
	<div class="clrboth"></div>
	<div class="block">
		<div class="title"><h3 class="bold">Winners</h3></div>
		<div class="clrboth"></div>
		
			<div class="clrboth"></div>
			<div class="content">
				<?php foreach($tournament_array as $tournament): ?>
					<?php $TOURNAMENT = $ci->tournament_entity->init('id', $tournament->id);?>
			
					<div class="rowitem2">
						<div class="tournament-title">
							<?php echo $TOURNAMENT->getName(); ?>
						</div>
						<div class="tournament-time-rannge">
							From <?php echo date('F d',$TOURNAMENT->getStartTime());?> to 
							<?php echo date('F d',$TOURNAMENT->getEndTime());?>
						</div>
						
						<div class="clrboth"></div>
						<div class="item-one-half">
							<a href="<?php echo site_url('cricket/tournament/weekly_winners/?t_id='.$tournament->id);?>">
								Weekly Winners
							</a>
						</div>
						<div class="item-one-half">
							<a href="<?php echo site_url('cricket/tournament/tournament_winners/?t_id='.$tournament->id);?>">
								Tournament Winners
							</a>
						</div>	
					</div>
							
					<div class="clrboth"></div>
				<?php endforeach; ?> 
			</div>
			<div class="clrboth"></div>
		
	</div>	
	<div class="clrboth"></div>
</div>
